home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / infop125.zip / PAGE_13.INC < prev    next >
Text File  |  1990-08-10  |  6KB  |  229 lines

  1. procedure page_13;
  2. type
  3.   iotbltype = record
  4.                 spclfunc: byte;
  5.                 devtype: byte;
  6.                 devattr: word;
  7.                 cylcount: word;
  8.                 medtype: byte;
  9.                 bpsec: word;
  10.                 secpclus: byte;
  11.                 resvsec: word;
  12.                 fats: byte;
  13.                 rootentries: word;
  14.                 numsecs: word;
  15.                 meddescr: byte;
  16.                 secpfat: word;
  17.                 secptrk: word;
  18.                 numheads: word;
  19.                 numhidden: longint;
  20.                 largesec: longint;
  21.                 reserved: array[$19..$1E] of byte;
  22.               end;
  23.  
  24. var
  25.   i : $00..$2B;
  26.   xbyte : byte;
  27.   xchar : char;
  28.   xFCB : array[$00..$2B] of byte;
  29.   xlong : longint;
  30.   xstring : string;
  31.   xword1 : word;
  32.   xword2 : word;
  33.   xword3, xword4, xword5: word;
  34.   iotable: iotbltype;
  35.   saveX, saveY: byte;
  36.  
  37. begin
  38.   caption2('LASTDRIVE');
  39.   drvname(lastdrv - 1);
  40.   writeln;
  41.   caption2('Logical drives');
  42.   with regs do begin
  43.     for xchar:='A' to 'Z' do begin
  44.       AH:=$0E;
  45.       DL:=ord(xchar) - ord('A');
  46.       MSDOS(regs);
  47.       AH:=$19;
  48.       MSDOS(regs);
  49.       if AL = DL then
  50.         drvname(AL)
  51.     end;
  52.     writeln;
  53.     AH:=$0E;
  54.     DL:=currdrv;
  55.     MSDOS(regs)
  56.   end;
  57.   caption2('Diskette drives');
  58.   if equip and $0001 = $0001 then
  59.     writeln(1 + equip and $00C0 shr 6)
  60.   else
  61.     writeln(0);
  62.   xword1:=longint(intvec[$1E]) shr 16;
  63.   xword2:=longint(intvec[$1E]) and $0000FFFF;
  64.   caption3('Sectors/track');
  65.   writeln(mem[xword1 : xword2 + 4]);
  66.   caption3('Bytes/sector');
  67.   writeln(mem[xword1 : xword2 + 3] shl 8);
  68.   caption3('On time (ms)');
  69.   writeln(125 * mem[xword1 : xword2 + 10]);
  70.   caption3('Off time (s)');
  71.   writeln(longint(mem[xword1 : xword2 + 2]) shl 16 / tick1 : 0 : 1);
  72.   caption3('Head settle time (ms)');
  73.   writeln(mem[xword1 : xword2 + 9]);
  74.   caption1('  Single drive is now ');
  75.   xbyte:=mem[BIOSdseg : $0104];
  76.   if xbyte <= ord('Z') - ord('A') then begin
  77.     drvname(xbyte);
  78.     writeln
  79.   end else if xbyte = $FF then
  80.     writeln('N/A')
  81.   else
  82.     unknown('status', xbyte, 2);
  83. (*  Byte 12:12 p.178  *)
  84.   caption2('Current drive and path');
  85.   getdir(0, xstring);
  86.   writeln(xstring);
  87.   with regs do
  88.     begin
  89.     AH:=$52;
  90.     MsDos(regs);
  91.     if (osmajor = 3) and (osminor = 0) then
  92.       begin
  93.       xword1:=MemW[ES:BX + $19];
  94.       xword2:=MemW[ES:BX + $17]
  95.       end
  96.     else
  97.       begin
  98.       xword1:=MemW[ES:BX + $18];
  99.       xword2:=MemW[ES:BX + $16]
  100.       end;
  101.     if osmajor = 4 then
  102.       xword5:=$58
  103.     else
  104.       xword5:=$51;
  105.     xword3:=xword2 + (xword5 * currdrv);
  106.     caption3('Drive type is');
  107.     case MemW[xword1:xword3 + $43] shr 14 of
  108.       0: Writeln('invalid');
  109.       1: Writeln('physical');
  110.       2: Writeln('network');
  111.       3: Writeln('Installable File System')
  112.     end;
  113.     if (osmajor >= 4) or ((osmajor = 3) and (osminor >= 20)) then
  114.       with regs do
  115.         begin
  116.         AH:=$44;
  117.         AL:=$0D;
  118.         BL:=0;
  119.         CH:=8;
  120.         CL:=$60;
  121.         DS:=Seg(iotable);
  122.         DX:=Ofs(iotable);
  123.         MsDos(regs);
  124.         if Flags and FCarry = 0 then
  125.           with iotable do
  126.             begin
  127.             caption3('removable');
  128.             if devattr and 1 = 0 then
  129.               Write('yes')
  130.             else
  131.               Write('no');
  132.             caption3('door lock');
  133.             yesorno(devattr and 2 = 2);
  134.             end
  135.         end;
  136.     caption3('JOIN''d ');
  137.     if MemW[xword1:xword3 + $43] and $2000 = $2000 then
  138.       begin
  139.       Write('yes');
  140.       caption3('actually');
  141.       xword4:=xword3;
  142.       while Mem[xword1:xword4] <> 0 do
  143.         begin
  144.         Write(Chr(Mem[xword1:xword4]));
  145.         Inc(xword4)
  146.         end;
  147.       Writeln;
  148.       end
  149.     else
  150.       Writeln('no');
  151.     caption3('SUBST''d');
  152.     if MemW[xword1:xword3 + $43] and $1000 = $1000 then
  153.       begin
  154.       Write('yes');
  155.       caption3('actually');
  156.       xword4:=xword3;
  157.       while Mem[xword1:xword4] <> 0 do
  158.         begin
  159.         Write(Chr(Mem[xword1:xword4]));
  160.         Inc(xword4)
  161.         end;
  162.       Writeln;
  163.       end
  164.     else
  165.       Writeln('no')
  166.     end;
  167.   caption3('Volume label');
  168.   for i:=$00 to $2B do
  169.     xFCB[i]:=$00;
  170.   xFCB[$00]:=$FF;         (* extended FCB *)
  171.   xFCB[$06]:=$08;         (* volume ID attribute *)
  172.   for i:=$08 to $12 do
  173.     xFCB[i]:=ord('?');
  174.   with regs do begin
  175.     AH:=$11;
  176.     DS:=seg(xFCB);
  177.     DX:=ofs(xFCB);
  178.     MSDOS(regs);
  179.     case AL of
  180.       $00 : begin
  181.         AH:=$2F;
  182.         MSDOS(regs);
  183.         i:=$08;
  184.         xchar:=char(mem[ES : BX + i]);
  185.         while (i <= $12) and (xchar > #0) do begin
  186.           write(showchar(xchar));
  187.           inc(i);
  188.           xchar:=char(mem[ES : BX + i])
  189.         end;
  190.         writeln
  191.       end;
  192.       $FF : writeln('(none)')
  193.       else
  194.         unknown('status', AL, 2)
  195.     end
  196.   end;
  197.   with regs do
  198.     begin
  199.     saveX:=WhereX;
  200.     saveY:=WhereY;
  201.     TextColor(LightRed+Blink);
  202.     Write('  *retrieving information*');
  203.     AH:=$1B;
  204.     MSDOS(regs);
  205.     GotoXY(saveX, saveY);
  206.     Write('                          ');
  207.     GotoXY(saveX, saveY);
  208.     media(mem[DS : BX], AL);
  209.     caption3('Clusters');
  210.     writeln(DX);
  211.     caption3('Sectors/cluster');
  212.     writeln(AL);
  213.     caption3('Bytes/sector');
  214.     writeln(CX)
  215.     end;
  216.   caption3('Total space (bytes)');
  217.   xlong:=disksize(0);
  218.   if xlong <> -1 then
  219.     writeln(xlong : 8)
  220.   else
  221.     writeln('(invalid drive)');
  222.   caption3('Free space (bytes) ');
  223.   xlong:=diskfree(0);
  224.   if xlong <> -1 then
  225.     write(xlong : 8)
  226.   else
  227.     write('(invalid drive)')
  228. end;
  229.